package com.polaris.live.im.db.entity

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey

/**
 * 商品预存
 *
 * @author Created by lucas on 2023/11/23 10:42
 */
@Entity(
    tableName = "purchase_pretreatment",
    indices = [
        Index(value = ["account_id", "product_id"])
    ]
)
data class PurchasePretreatmentEntity(
    /**
     * 数据库主键
     */
    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "table_id")
    val tableId: Int? = null,
    /**
     * 所属的用户id hash
     */
    @ColumnInfo(name = "account_id")
    val accountId: String,
    /**
     * 价格id
     */
    @ColumnInfo(name = "product_id")
    val productId: String,
    /**
     * 服务端生成的token
     */
    @ColumnInfo(name = "token")
    val token: String? = null,
    /**
     * 创建时间
     */
    @ColumnInfo(name = "timestamp")
    val timestamp: Long
)
